package com.bcu.wish.service.impl;

import com.bcu.wish.entity.Message;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import com.bcu.wish.mapper.TimeMapper;
import com.bcu.wish.entity.Time;
import com.bcu.wish.service.TimeService;

import java.util.List;

@Service
public class TimeServiceImpl implements TimeService{

    @Resource
    private TimeMapper timeMapper;

    @Override
    public Message deleteByPrimaryKey(Integer timeId) {
        return timeMapper.deleteByPrimaryKey(timeId)>0? Message.success(null):Message.fail(null);
    }

    @Override
    public Message insert(Time record) {
        return timeMapper.insert(record)>0? Message.success(null):Message.fail(null);
    }

    @Override
    public Message insertSelective(Time record) {
        return timeMapper.insertSelective(record)>0? Message.success(null):Message.fail(null);
    }

    @Override
    public Message<Time> selectByPrimaryKey(Integer timeId) {
        return Message.success(null).add(timeMapper.selectByPrimaryKey(timeId));
    }

    @Override
    public Message updateByPrimaryKeySelective(Time record) {
        return timeMapper.updateByPrimaryKeySelective(record)>0? Message.success(null):Message.fail(null);
    }

    @Override
    public Message updateByPrimaryKey(Time record) {
        return timeMapper.updateByPrimaryKey(record)>0? Message.success(null):Message.fail(null);
    }

    @Override
    public Message<List<Time>> selectAll() {
        return Message.success(null).add(timeMapper.selectAll());
    }

}
